package com.sjyang.redislearn;

import com.sjyang.lettuce.LettuceClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.redis.core.StringRedisTemplate;

@SpringBootApplication
@ComponentScan({"com.sjyang.lettuce"})
public class RedislearnApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext con = SpringApplication.run(RedislearnApplication.class, args);
        StringRedisTemplate stringRedisTemplate = con.getBean(StringRedisTemplate.class);
        stringRedisTemplate.opsForValue().set("key2","杨赛军");
        System.out.println(stringRedisTemplate.opsForValue().get("key2"));
        LettuceClient lettuceClient = con.getBean(LettuceClient.class);
        lettuceClient.redisClient();
        }
}
